package com.jhmk.jhecis.config.job;

import org.quartz.Job;
import org.quartz.JobDetail;
import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;

import java.time.LocalDateTime;

//@Component
public class Job1 implements Job {

    public void myTask1() {
        System.out.println("MyJob1 myTask1任务开始 : " + LocalDateTime.now().toLocalTime() + "，线程：" + Thread.currentThread().getName());
    }

    @Override
    public void execute(JobExecutionContext context) throws JobExecutionException {
        JobDetail jd= context.getJobDetail();
        String name= jd.getKey().getName();
        // 处理相应的注入service业务
        String data = "job1";//userService.get(id);
        System.out.println(name);
        System.out.println("MyJob2 任务开始 : " + LocalDateTime.now().toLocalTime() + "，线程：" + Thread.currentThread().getName());
    }
}
